<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1.客户先输入年份和月份
        let year = prompt('请输入年份');
        let month = prompt('请输入月份');

        //2.先把2月排除，然后写31天的月份
        if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
            document.write(`${year}年的${month}月是一共有31天`)
        } else if (month == 4 || month == 6 || month == 9 || month == 11) {
            document.write(`${year}年的${month}月是一共有30天`)
        } else{
            if ((year % 400 == 0)|| (year % 4 == 0 && year % 100 != 0)) {
                document.write(`${year}年的${month}月是一共有29天`);
            }else{
                document.write(`${year}年的${month}月是一共有28天`)
            }
        };
    </script>
</body>

</html>